import time
now = time.time()
print(now)

obj = time.localtime()
print(obj)

obj2 = time.localtime(60)  # 60秒
print(type(obj2),obj2)
print('年份',obj2.tm_year)
print('月份',obj2.tm_mon)
print('日期',obj2.tm_mday)
print('时',obj2.tm_hour)
print('分',obj2.tm_min)
print('秒',obj2.tm_sec)
print('星期',obj2.tm_wday)
print('今年的多少天',obj2.tm_yday)

print(time.ctime(1713770555.2480311))  # 时间戳 转换成易读的字符串

# 日期时间格式化
print(time.strftime('%Y-%m-%d',time.localtime()))
print(time.strftime('%H:%M:%S',time.localtime()))
print(time.strftime('%B',time.localtime())) # 月份
print(time.strftime('%A',time.localtime())) # 星期

# 字符串转换成struct_time
print(time.strptime('2008-08-08','%Y-%m-%d'))

# 程序暂停3秒后执行
time.sleep(3)
print('helloworld')